package Interfaces;

import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class frmPromedio extends javax.swing.JFrame implements ActionListener{
	
	private static final long serialVersionUID = 1L;
	public JTextField txtPromedio;
	public JLabel lblPromedio;
	public JLabel lblTitulo;
	public JButton btnSalir;
public frmPromedio() {
		
		setLayout(new GridLayout(4,1));
		setSize(200,240);
		setLocation(500, 250);
		setTitle(".-.Promedio.-.");
		
		txtPromedio = new JTextField(10);
		lblTitulo = new JLabel(".-. Promedio de la seccion .-.");
		lblPromedio = new JLabel("Promedio:     ");
		btnSalir = new JButton("    Salir   ");
		
		JPanel pnTitulo = new JPanel();
		JPanel panelnorte= new JPanel(new GridLayout(4,1));
		JPanel panel1= new JPanel(new FlowLayout(FlowLayout.CENTER));
		JPanel pnSur= new JPanel(new FlowLayout(FlowLayout.CENTER));
		JPanel panel2= new JPanel(new FlowLayout(FlowLayout.CENTER));
		
		pnTitulo.add(lblTitulo);
		panel1.add(lblPromedio);
		panel1.add(txtPromedio);
		panelnorte.add(panel1);
		panel2.add(btnSalir);
		pnSur.add(panel2);	
		
		add(pnTitulo);
		add(panel1);
		add(panel2);
	this.btnSalir.addActionListener(this);
	}
public void actionPerformed(ActionEvent accion) {
if(accion.getSource()==this.btnSalir){
	this.setVisible(false);
}
	
}

}
